<template>
  <div class="nav-container">
    <aside class="nav-top">
      <div class="nav-left-section">
        <img class="logo-img" src="@/assets/png/logo.png" alt="" />
        <span class="logo-title">Vue3-Ts-Vite-Admin</span>
      </div>
      <div class="nav-right-section">
        <img @click="menuOpenHandler" class="logo-img" src="@/assets/png/menu_icon.png" alt="" />
      </div>
    </aside>
    <div class="app-content">
      <router-view></router-view>
    </div>
  </div>
</template>

<script lang="ts" setup>

const props = defineProps({
    openStatus: {
        type: Boolean,
        required: true
    }
})

const emits = defineEmits(['navbarMenuTap']);


const menuOpenHandler = () => {
    emits('navbarMenuTap', !props.openStatus);
};
</script>

<style lang="scss">
.nav-container {
    height: 100%;

    .app-content {
        position: fixed;
        top: 50px;
        right: 0;
        bottom: 0;
        left: 0;
        overflow: scroll;
    }

    .nav-top {
        border-bottom: 1px solid #e5e5e5;
        height: 50px;
        line-height: 50px;
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        background: #fff;
        display: flex;

        .nav-left-section {
            width: 80%;
            display: flex;
            justify-content: flex-start;
            align-items: center;
            padding-left: 10px;

            .logo-title {
                margin-left: 10px;
                font-size: 19px;
                font-weight: 550;
            }
        }

        .nav-right-section {
            width: 20%;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .logo-img {
            width: 30px;
            height: 30px;
        }
    }
}
</style>
